//
//  XLHTTPSessionManager+matchOrder.m
//  XiangLove
//
//  Created by 陈宪栋 on 2018/1/25.
//  Copyright © 2018年 BAOMIHUA.COM. All rights reserved.
//

#import "XLHTTPSessionManager+matchOrder.h"
//#import <UIApplication+YYAdd.h>

@implementation XLHTTPSessionManager (matchOrder)
- (RACSignal *)requestMatchingWithUserId:(NSString *)userId {
    NSString *URLString = @"/Api/v1/Matching/RequestMatching";
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    [parameters setObject:userId ?: @""                                         forKey:@"userId"];
    [parameters setObject:QudaoName                                         forKey:@"qudao"];
    [parameters setObject:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]   forKey:@"version"];
    [parameters setObject:@"2"                                                  forKey:@"appid"];
    return [self GET:URLString parameters:parameters resultClass:nil];
}

- (RACSignal *)quitMatchingWithUserId:(NSString *)userId {
    NSString *URLString = @"/Api/v1/Matching/QuitMatching";
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    [parameters setObject:userId ?: @""                                         forKey:@"userId"];
    [parameters setObject:QudaoName                                         forKey:@"qudao"];
    [parameters setObject:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]   forKey:@"version"];
    [parameters setObject:@"2"                                                  forKey:@"appid"];
    return [self GET:URLString parameters:parameters resultClass:nil];
}

- (RACSignal *)getOnlineAnchor {
    NSString *URLString = @"/Api/v1/Matching/OnlineAnchor";
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    [parameters setObject:QudaoName                                         forKey:@"qudao"];
    [parameters setObject:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]   forKey:@"version"];
    [parameters setObject:@"2"                                                  forKey:@"appid"];
    return [self GET:URLString parameters:parameters resultClass:nil];
}

- (RACSignal *)getOrderListWithAnchorId:(NSString *)anchorId {
    NSString *URLString = @"/Api/v1/Matching/GetMatchingUserInfo";
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    [parameters setObject:QudaoName                                         forKey:@"qudao"];
    [parameters setObject:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]   forKey:@"version"];
    [parameters setObject:@"2"                                                  forKey:@"appid"];
    [parameters setObject:anchorId ?:@""                                        forKey:@"anchorId"];
    return [self GET:URLString parameters:parameters resultClass:nil];
}

- (RACSignal *)grabOrderWithUserId:(NSString *)userId anchorId:(NSString *)anchorId matchId:(NSString *)matchId {
    NSString *URLString = @"/Api/v1/Matching/Rob";
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    [parameters setObject:userId ?: @""                                         forKey:@"userId"];
    [parameters setObject:anchorId ?: @""                                       forKey:@"anchorId"];
    [parameters setObject:matchId ?: @""                                        forKey:@"matchId"];
    [parameters setObject:QudaoName                                         forKey:@"qudao"];
    [parameters setObject:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]   forKey:@"version"];
    [parameters setObject:@"2"                                                  forKey:@"appid"];
    return [self GET:URLString parameters:parameters resultClass:nil];
}


@end
